<template>
   <div class="box">
    <h4 style="color: #1ba9ba">今日支付方式对比</h4>
    <div id="pietwo">
     
    </div>
 </div>
</template>

<script setup>
import * as echarts from 'echarts';
import { onMounted } from 'vue';

onMounted(()=>{
var chartDom = document.getElementById('pietwo');
var myChart = echarts.init(chartDom);
var option;

option = {
  legend: {
    top: '5%',
    itemHeight: 8,
    itemWidth: 8,
    icon: "circle",
    left: 'center'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: ['40%', '60%'],
      top:30,
      label: {
        show: false,
        position: 'center'
      },

      data: [
        { value: 1048, name: '支付宝' },
        { value: 735, name: '微信' },
        { value: 58, name: '其他' },
      ],
      color: ['#679CF6', '#169F5E','#B2B7C6'],
      width: '100%',
    }
  ]
};

option && myChart.setOption(option);

    })
</script>

<style scoped lang="scss">
.box{
  text-align: center;
  padding: 10px;
}
#pietwo{
    width: 400px;
    height: 200px;
}
</style>